
clear all

use "data.dta"

ssc install estout, replace

ssc install coefplot, replace

net from http://www.stata.com
net cd users
net cd vwiggins
net install grc1leg

xtset id year, yearly

quietly: ///
xtreg ///
log_asset ///
time ///
fed_exec_form ///
fed_exec_past ///
fed_exec_infm ///
fed_legs_form ///
fed_legs_infm ///
reg_exec_form ///
reg_exec_infm ///
reg_legs_form ///
c.time#c.fed_exec_form ///
c.time#c.fed_exec_past ///
c.time#c.fed_exec_infm ///
c.time#c.fed_legs_form ///
c.time#c.fed_legs_infm ///
c.time#c.reg_exec_form ///
c.time#c.reg_exec_infm ///
c.time#c.reg_legs_form ///
i.sector, ///
vce(cluster id)

eststo m1: margins, ///
at( ///
time = (0(1)7) ///
fed_exec_form = 0 ///
fed_exec_past = 0 ///
fed_exec_infm = 0 ///
fed_legs_form = 0 ///
fed_legs_infm = 0 ///
reg_exec_form = 0 ///
reg_exec_infm = 0 ///
reg_legs_form = 0 ///
) ///
post

quietly: ///
xtreg ///
log_asset ///
time ///
fed_exec_form ///
fed_exec_past ///
fed_exec_infm ///
fed_legs_form ///
fed_legs_infm ///
reg_exec_form ///
reg_exec_infm ///
reg_legs_form ///
c.time#c.fed_exec_form ///
c.time#c.fed_exec_past ///
c.time#c.fed_exec_infm ///
c.time#c.fed_legs_form ///
c.time#c.fed_legs_infm ///
c.time#c.reg_exec_form ///
c.time#c.reg_exec_infm ///
c.time#c.reg_legs_form ///
i.sector, ///
vce(cluster id)

eststo m2: margins, ///
at( ///
time = (0(1)7) ///
fed_exec_form = 0 ///
fed_exec_past = 0 ///
fed_exec_infm = 1 ///
fed_legs_form = 0 ///
fed_legs_infm = 0 ///
reg_exec_form = 0 ///
reg_exec_infm = 0 ///
reg_legs_form = 0 ///
) ///
post

coefplot m1 m2, ///
vert ///
title("Log scale", margin(medium)) ///
xtitle("Year", size(medlarge) margin(small)) ///
ytitle("Log assets", size(medlarge) margin(small)) ///
xlabel(, angle(vert)) ///
ylabel(, angle(horiz) nogrid) ///
scheme(s1mono) ///
graphregion(fcolor(white) lcolor(white)) ///
legend( ///
subtitle("Connection") ///
label(2 "None") ///
label(4 "Federal executive informal") ///
) ///
coeflabels( ///
1._at = "2003" ///
2._at = "2004" ///
3._at = "2005" ///
4._at = "2006" ///
5._at = "2007" ///
6._at = "2008" ///
7._at = "2009" ///
8._at = "2010" ///
) ///
recast(line) lwidth(*2) ///
nooffset ///
ciopts(recast(rline) lpattern(dash)) ///
name(g1, replace) ///
nodraw

coefplot m1 m2, ///
transform(* = exp(@)) ///
noci ///
vert ///
title("Original scale", margin(medium)) ///
xtitle("Year", size(medlarge) margin(small)) ///
ytitle("Assets, $ mln", size(medlarge) margin(small)) ///
xlabel(, angle(vert)) ///
ylabel(, angle(horiz) nogrid) ///
scheme(s1mono) ///
graphregion(fcolor(white) lcolor(white)) ///
coeflabels( ///
1._at = "2003" ///
2._at = "2004" ///
3._at = "2005" ///
4._at = "2006" ///
5._at = "2007" ///
6._at = "2008" ///
7._at = "2009" ///
8._at = "2010" ///
) ///
recast(line) lwidth(*2) ///
nooffset ///
name(g2, replace) ///
nodraw

grc1leg g1 g2, ///
scheme(s1mono) ///
graphregion(fcolor(white) lcolor(white)) ///
name(g0, replace)

graph display g0, xsize(6) ysize(4)
